//
//  FKWithdrawDetail.m
//  WanTao
//
//  Created by Macbook Pro on 2019/3/29.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKWithdrawDetail.h"

@implementation FKWithdrawDetail

- (void)mj_keyValuesDidFinishConvertingToObject
{
    _moneyStr = fkFORMAT(@"￥%@", _money);
    _addTime = [_add_time fk_timeWithFormat:@"yyyy-MM-dd HH:mm"];
    _examineTime = [_examine_time fk_timeWithFormat:@"yyyy-MM-dd HH:mm"];
    // 10 待审核 20 审核成功 30 审核失败
    if ([_status isEqualToString:@"10"]) {
        _statusName = @"待审核";
        _statusTitleColor = [UIColor fk_colorWithHex:0x56B35A];
        _statusBgColor = fkColorAlpha(86, 179, 90, 0.3);
    } else if ([_status isEqualToString:@"20"]) {
        _statusName = @"审核成功";
        _statusTitleColor = [UIColor fk_colorWithHex:0x56B35A];
        _statusBgColor = fkColorAlpha(86, 179, 90, 0.3);
    } else if ([_status isEqualToString:@"30"]) {
        _statusName = @"审核失败";
        _statusTitleColor = [UIColor fk_colorWithHex:0xFF4444];
        _statusBgColor = fkColorAlpha(255, 68, 68, 0.3);
    }
    
    CGFloat descH = [_desc sizeWithAttributes:@{NSFontAttributeName : fk_adjustFont(16)}].height;
//    CGFloat subRowH = [@"提现金额" sizeWithAttributes:@{NSFontAttributeName : fk_adjustFont(12)}].height;
    CGFloat subRowH = fk_adjustW(20);
    if ([_withdraw_type isEqualToString:@"1"]) { // 微信提现
        _cellH = fk_adjustW(10) + descH + 3 * subRowH + fk_adjustW(8);
        
//        if (_examine_time) {
//            _cellH = fk_adjustW(10) + descH + 3 * (subRowH + fk_adjustW(10)) + fk_adjustW(12);
//        } else {
//            _cellH = fk_adjustW(10) + descH + 2 * (subRowH + fk_adjustW(10)) + fk_adjustW(12);
//        }
    } else if ([_withdraw_type isEqualToString:@"2"]) {
        _cellH = fk_adjustW(10) + descH + 5 * subRowH + fk_adjustW(8);
        
//        if (_examine_time) {
//            _cellH = fk_adjustW(10) + descH + 5 * (subRowH + fk_adjustW(10)) + fk_adjustW(12);
//        } else {
//            _cellH = fk_adjustW(10) + descH + 4 * (subRowH + fk_adjustW(10)) + fk_adjustW(12);
//        }
    }
}

@end
